package com.example.tianxi.yuexiuhhpatient;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.TextView;

public class EditHistoryInfoActivity extends Activity {

    private TextView back;
    private TextView title;
    private TextView action;

    private TextView textView1;
    private TextView textView2;
    private TextView textView3;
    private TextView textView4;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_edit_history_info);

        initView();

        initData();

    }

    public void initView(){
        back = (TextView)findViewById(R.id.back);
        back.setText("返回");
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        title = (TextView)findViewById(R.id.title);
        title.setText("编辑病历");

        action = (TextView)findViewById(R.id.action);
        action.setText("保存");

        textView1 = (TextView)findViewById(R.id.textView1);
        textView2 = (TextView)findViewById(R.id.textView2);
        textView3 = (TextView)findViewById(R.id.textView3);
        textView4 = (TextView)findViewById(R.id.textView4);
    }

    public void initData(){
        boolean flag = getIntent().getBooleanExtra("flag",false);
        if(flag){//为true，编辑
            Intent intent = getIntent();
            textView1.setText(intent.getStringExtra("textview1"));
            textView2.setText(intent.getStringExtra("textview2"));
            textView3.setText(intent.getStringExtra("textview3"));
            textView4.setText(intent.getStringExtra("textview4"));
        }else{

        }
    }

}
